﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using SmartCity.Shared;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;

namespace CommonManagement
{
    /// <summary>
    /// 城市控制器
    /// </summary>
    [RemoteService]
    [Area("commonManagement")]
    [Route("api/commonManagement/gps")]
    public class CityController : AbpController, ICityAppService
    {
        private readonly ICityAppService _cityAppService;

        public CityController(
            ICityAppService cityAppService)
        {
            _cityAppService = cityAppService;
        }

        // 1.8.2 获取省的城市
        [HttpGet]
        [Route("city")]
        public Task<ResultResponse<IList<CityDto>>> ListAsync(string provinceName, string name = null)
        {
            return _cityAppService.ListAsync(provinceName, name);
        }
    }
}